﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Include/Admin.master" AutoEventWireup="true"
    CodeFile="Manage.aspx.cs" Inherits="Admin_WGXX_Manage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../../Style/Common/DatePage.css" rel="stylesheet" type="text/css" />
    <link href="../../Scripts/jquery-easyui-1.3.1/themes/default/easyui.css" rel="stylesheet"
        type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true" ID="ScriptManager1" />
    <ajaxToolkit:CalendarExtender ID="cettime" runat="server" TargetControlID="txtAddTimeFrom"
        Format="yyyy年MM月dd日" PopupPosition="Right" />
    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtAddTimeTo"
        Format="yyyy年MM月dd日" PopupPosition="Right" />
    <table cellspacing="0" cellpadding="0" style="width: 100%; height: 30px; padding-bottom: 5px;
        border: 1px; border-color: #66CCFF;">
        <tr style="background-image: url('../../images/管理员页面/title_bg1.jpg'); background-repeat: repeat-x;">
            <td style="font-weight: bold; font-size: large; font-family: 仿宋;">
                <strong>【违规信息管理】</strong>
            </td>
        </tr>
    </table>
    <table class="editTable" cellspacing="1">
        <tr>
            <th>
                违规性质
            </th>
            <td>
                <asp:DropDownList ID="drpWGXZ" runat="server">
                </asp:DropDownList>
            </td>
            <th>
                违规类型
            </th>
            <td>
                <asp:DropDownList ID="drpWGLX" runat="server">
                </asp:DropDownList>
            </td>
            <th>
                添加时间
            </th>
            <td colspan="2">
                从：<asp:TextBox ID="txtAddTimeFrom" runat="server" class="easyui-datebox"></asp:TextBox>到：<asp:TextBox
                    ID="txtAddTimeTo" runat="server" class="easyui-datebox"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <th>
                违规对象
            </th>
            <td>
                <asp:TextBox ID="txtADdUserID" runat="server"></asp:TextBox>
                <img alt='查询' class="SearchUser" style="cursor" src="../../images/管理员页面/search.png" /><img
                    class="Clear_txtADdUserID" alt='清空' style="cursor" src="../../images/管理员页面/clear.gif" />
            </td>
            <th>
                违规对象类型
            </th>
            <td>
                <asp:DropDownList ID="drpWGDXLX" runat="server">
                </asp:DropDownList>
            </td>
            <th>
                操作员
            </th>
            <td>
                <asp:TextBox ID="txtAdminUserID" runat="server" ></asp:TextBox>
                <img alt='查询' class="SearchUser2" src="../../images/管理员页面/search.png" /><img id="Img2"
                    class="Clear_txtAdminUserID" alt='清空' src="../../images/管理员页面/clear.gif" />
            </td>
            <td>
                <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" />
            </td>
        </tr>
    </table>
    <br />
    <asp:ListView ID="lvDate" runat="server" DataKeyNames="ID" OnItemCanceling="lvDate_ItemCanceling"
        OnItemDeleting="lvDate_ItemDeleting" OnItemEditing="lvDate_ItemEditing" OnItemUpdating="lvDate_ItemUpdating"
        OnPagePropertiesChanged="lvDate_PagePropertiesChanged">
        <LayoutTemplate>
            <table class="editTable" width="100%" cellspacing="1">
                <tr>
                    <th>
                        违规性质
                    </th>
                    <th>
                        违规类型
                    </th>
                    <th>
                        违规处理方式
                    </th>
                    <th>
                        违规说明
                    </th>
                    <th>
                        违规用户
                    </th>
                    <th>
                        违规用户类型
                    </th>
                    <th>
                        违规时间
                    </th>
                    <th>
                        操作员
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <%#Enum.GetName(typeof(WGXX.kindWG), Eval("Kind"))%>
                </td>
                <td>
                    <%#Enum.GetName(typeof(WGXX.typeWG), Eval("type"))%>
                </td>
                <td>
                    <%#Eval("Result")%>
                </td>
                <td>
                    <%#Eval("Remark")%>
                </td>
                <td>
                    <%#GetUserName(Eval("RelationID"))%>
                </td>
                <td>
                    <%#Enum.GetName(typeof(WGXX.typeUserWG), Eval("UserType"))%>
                </td>
                <td>
                    <%#DongDong.Common.Misc.ConvertToShortDateTime(Eval("AddTime"),"yyyy年MM月dd日")%>
                </td>
                <td>
                    <%#GetUserName(Eval("AdminUserID"))%>
                </td>
                <td>
                    <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="Edit" Text="修改"></asp:LinkButton>&nbsp;&nbsp;
                    <asp:LinkButton ID="lbtnDelete" runat="server" Text="删除" OnClientClick="return confirm('您确定要删除该项吗?');"
                        CommandName="Delete"></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
        <EditItemTemplate>
            <tr>
                <td>
                    <asp:DropDownList ID="drpEditWGXZ" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:DropDownList ID="drpEditWGLX" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:TextBox ID="txtResult" runat="server" Text='<%#Eval("Result")%>' MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtResult"
                        ErrorMessage="违规处理方式不能为空" SetFocusOnError="true" ValidationGroup="Update"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:TextBox ID="txtRemark" runat="server" Text='<%#Eval("Remark")%>' MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtRemark"
                        ErrorMessage="违规说明不能为空" SetFocusOnError="true" ValidationGroup="Update"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <%#GetUserName(Eval("RelationID"))%>
                </td>
                <td>
                    <asp:DropDownList ID="drpEditWGDXLX" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                    <%#DongDong.Common.Misc.ConvertToShortDateTime(Eval("AddTime"),"yyyy年MM月dd日")%>
                </td>
                <td>
                    <%#GetUserName(Eval("AdminUserID"))%>
                </td>
                <td style="width: 130px">
                    <asp:LinkButton ID="lbtnCancel" runat="server" Text="取消" CommandName="Cancel"></asp:LinkButton>&nbsp;&nbsp;
                    <asp:LinkButton ID="lbtnUpdate" runat="server" Text="更新" CommandName="Update" ValidationGroup="Update"></asp:LinkButton>
                </td>
            </tr>
        </EditItemTemplate>
        <EmptyDataTemplate>
            没有数据<br />
            <br />
        </EmptyDataTemplate>
    </asp:ListView>
    <div style="padding: 4px; text-align: center;">
        <asp:DataPager ID="Pager" runat="server" PagedControlID="lvDate" OnPreRender="Pager_PreRender"
            PageSize="20">
            <Fields>
                <asp:NumericPagerField ButtonCount="10" CurrentPageLabelCssClass="CurrentPage" NumericButtonCssClass="Page" />
                <asp:NextPreviousPagerField ShowLastPageButton="true" ShowPreviousPageButton="true"
                    ShowFirstPageButton="true" />
                <asp:TemplatePagerField>
                    <PagerTemplate>
                        共<%=Pager.TotalRowCount%>条
                    </PagerTemplate>
                </asp:TemplatePagerField>
            </Fields>
        </asp:DataPager>
    </div>
    <asp:HiddenField ID="hdlAddUserID" runat="server" />
    <asp:HiddenField ID="hdlAddUserID2" runat="server" />
    <asp:HiddenField ID="hdlAdminUserID" runat="server" />
    <script type="text/javascript">
        $(document).ready(function () {
            $(".SearchUser").click(function () {
                OpenPage("../Client/Manage.aspx?IsOpen=1", "<%=hdlAddUserID.ClientID %>", "<%=txtADdUserID.ClientID %>");
            })

            $(".SearchUserAdd").click(function () {
                OpenPage("../Client/Manage.aspx?IsOpen=1", "<%=hdlAddUserID2.ClientID %>", "<%=txtAddAddUserID.ClientID%>");
            })
            $(".SearchUser2").click(function () {
                OpenPage("../Client/Manage.aspx?IsOpen=1", "<%=hdlAdminUserID.ClientID %>", "<%=txtAdminUserID.ClientID%>");
            })
            $(".Clear_txtADdUserID").click(function () {
                ClearText("<%=hdlAddUserID.ClientID %>", "<%=txtADdUserID.ClientID %>");
            })
            $(".Clear_txtAdminUserID").click(function () {
                ClearText("<%=hdlAdminUserID.ClientID %>", "<%=txtAdminUserID.ClientID %>");
            })
        })
    </script>
    <br />
    <br />
    <asp:HyperLink ID="lnkAdd" runat="server" Text="添加违规记录" ForeColor="Blue"></asp:HyperLink>
    <asp:Panel ID="pnlAdd" runat="server" CssClass="addPnl">
        <h2>
            添加违规信息
        </h2>
        <p>
            请完成下面的内容:
        </p>
        <table class="editTable" cellspacing="1">
            <tr>
                <th>
                    违规性质
                </th>
                <td align="center">
                    <asp:DropDownList ID="drpAddWGXZ" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorDrpAddWGXZ" runat="server"
                        ControlToValidate="drpAddWGXZ" ErrorMessage="违规性质请选择" SetFocusOnError="true"
                        ValidationGroup="WgxxAdd" InitialValue="0"></asp:RequiredFieldValidator>
                </td>
                <th>
                    违规类型
                </th>
                <td align="center">
                    <asp:DropDownList ID="drpAddWGLX" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorDrpAddWGLX" runat="server"
                        ControlToValidate="drpAddWGLX" ErrorMessage="违规类型请选择" SetFocusOnError="true"
                        ValidationGroup="WgxxAdd" InitialValue="0"></asp:RequiredFieldValidator>
                </td>
                <th>
                    违规处理方式
                </th>
                <td align="center">
                    <asp:TextBox ID="txtAddResult" runat="server" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTxtAddResult" runat="server"
                        ControlToValidate="txtAddResult" ErrorMessage="违规处理方式不能为空" SetFocusOnError="true"
                        ValidationGroup="WgxxAdd"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    违规说明
                </th>
                <td align="center">
                    <asp:TextBox ID="txtAddRemark" runat="server" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTxtAddRemark" runat="server"
                        ControlToValidate="txtAddRemark" ErrorMessage="违规说明不能为空" SetFocusOnError="true"
                        ValidationGroup="WgxxAdd"></asp:RequiredFieldValidator>
                </td>
                <th>
                    违规用户
                </th>
                <td align="center">
                    <asp:TextBox ID="txtAddAddUserID" ReadOnly="true" runat="server"></asp:TextBox>
                    <img alt='查询' class="SearchUserAdd" src="../../images/管理员页面/search.png" /><img id="Clear"
                        alt='清空' src="../../images/管理员页面/clear.gif" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTxtAddUserID" runat="server"
                        ControlToValidate="txtAddAddUserID" ErrorMessage="违规用户不能为空" SetFocusOnError="true"
                        ValidationGroup="WgxxAdd"></asp:RequiredFieldValidator>
                </td>
                <th>
                    违规用户类型
                </th>
                <td align="center">
                    <asp:DropDownList ID="drpAddWGDXLX" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorDrpAddWGDXLX" runat="server"
                        ControlToValidate="drpAddWGDXLX" ErrorMessage="用户类型请选择" SetFocusOnError="true"
                        ValidationGroup="WgxxAdd" InitialValue="0"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="6" align="center">
                    <asp:Button ID="btnAdd" runat="server" Text="添加" ValidationGroup="WgxxAdd" OnClick="btnAdd_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <ajaxToolkit:PopupControlExtender ID="PopUpExtender" runat="server" TargetControlID="lnkAdd"
        PopupControlID="pnlAdd" Position="Bottom">
    </ajaxToolkit:PopupControlExtender>
    <script src="../../Scripts/jquery-easyui-1.3.1/jquery.easyui.min.js" type="text/javascript"></script>
</asp:Content>
